package com.hnevc.caoliuye;

import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        int[] a = new int[10];//定义一个大小为10的整形数组
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入10个整数：");
        int max = 0;
        if (sc.hasNextInt()){
            for (int i = 0; i < a.length; i++) {
                a[i] = sc.nextInt();
                if (a[i] >= max){
                    max = a[i];
                }
            }
            System.out.printf("数组a的最大值为：" + max);//输入数值的最大值
        }else {
            System.out.printf("请输入整数！");//输入整数
        }
    }
}
